const express = require('express')
const router = express.Router()

const toJson = (data) => {
    return JSON.stringify(data)
}

// router.get('/login', (req, res) => {
//     const body = {
//         "msg": "操作成功",
//         "code": 200,
//         "token": "1234567890"
//     }
//     res.send(toJson(body))
// })
router.get('/system/role/authUser/unallocatedList', (req, res) => {
    const body = {
        "total": 1,
        "rows": [
            {
                "createBy": null,
                "createTime": "2024-06-30 11:27:11",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "userId": 1,
                "deptId": 103,
                "userName": "admin",
                "nickName": "领导",
                "email": "ry@163.com",
                "phonenumber": "15888888888",
                "sex": null,
                "avatar": null,
                "password": null,
                "status": "0",
                "delFlag": null,
                "loginIp": null,
                "loginDate": null,
                "dept": {
                    "createBy": null,
                    "createTime": null,
                    "updateBy": null,
                    "updateTime": null,
                    "remark": null,
                    "deptId": 103,
                    "parentId": null,
                    "ancestors": null,
                    "deptName": null,
                    "orderNum": null,
                    "leader": null,
                    "phone": null,
                    "email": null,
                    "status": null,
                    "delFlag": null,
                    "parentName": null,
                    "children": []
                },
                "roles": [],
                "roleIds": null,
                "postIds": null,
                "roleId": null,
                "admin": true
            }
        ],
        "code": 200,
        "msg": "查询成功"
    }
    res.send(toJson(body))
})
router.get('/system/role/authUser/allocatedList', (req, res) => {
    const body = {
        "total": 1,
        "rows": [
            {
                "createBy": null,
                "createTime": "2024-06-30 11:27:11",
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "userId": 2,
                "deptId": 105,
                "userName": "ry",
                "nickName": "领导",
                "email": "ry@qq.com",
                "phonenumber": "15666666666",
                "sex": null,
                "avatar": null,
                "password": null,
                "status": "0",
                "delFlag": null,
                "loginIp": null,
                "loginDate": null,
                "dept": {
                    "createBy": null,
                    "createTime": null,
                    "updateBy": null,
                    "updateTime": null,
                    "remark": null,
                    "deptId": 105,
                    "parentId": null,
                    "ancestors": null,
                    "deptName": null,
                    "orderNum": null,
                    "leader": null,
                    "phone": null,
                    "email": null,
                    "status": null,
                    "delFlag": null,
                    "parentName": null,
                    "children": []
                },
                "roles": [],
                "roleIds": null,
                "postIds": null,
                "roleId": null,
                "admin": false
            }
        ],
        "code": 200,
        "msg": "查询成功"
    }
    res.send(toJson(body))
})
router.get('/system/role/2', (req, res) => {
    const body = {
        "msg": "操作成功",
        "code": 200,
        "data": {
            "createBy": null,
            "createTime": "2024-06-30 11:27:15",
            "updateBy": null,
            "updateTime": null,
            "remark": "普通角色",
            "roleId": 2,
            "roleName": "普通角色",
            "roleKey": "common",
            "roleSort": 2,
            "dataScope": "2",
            "menuCheckStrictly": true,
            "deptCheckStrictly": true,
            "status": "0",
            "delFlag": "0",
            "flag": false,
            "menuIds": null,
            "deptIds": null,
            "permissions": null,
            "admin": false
        }
    }
    res.send(toJson(body))
})
router.get('/system/menu/roleMenuTreeselect/2', (req, res) => {
    const body = {
        "msg": "操作成功",
        "code": 200,
        "menus": [
            {
                "id": 1,
                "label": "系统管理",
                "children": [
                    {
                        "id": 100,
                        "label": "用户管理",
                        "children": [
                            {
                                "id": 1000,
                                "label": "用户查询"
                            },
                            {
                                "id": 1001,
                                "label": "用户新增"
                            },
                            {
                                "id": 1002,
                                "label": "用户修改"
                            },
                            {
                                "id": 1003,
                                "label": "用户删除"
                            },
                            {
                                "id": 1004,
                                "label": "用户导出"
                            },
                            {
                                "id": 1005,
                                "label": "用户导入"
                            },
                            {
                                "id": 1006,
                                "label": "重置密码"
                            }
                        ]
                    },
                    {
                        "id": 101,
                        "label": "角色管理",
                        "children": [
                            {
                                "id": 1007,
                                "label": "角色查询"
                            },
                            {
                                "id": 1008,
                                "label": "角色新增"
                            },
                            {
                                "id": 1009,
                                "label": "角色修改"
                            },
                            {
                                "id": 1010,
                                "label": "角色删除"
                            },
                            {
                                "id": 1011,
                                "label": "角色导出"
                            }
                        ]
                    },
                    {
                        "id": 102,
                        "label": "菜单管理",
                        "children": [
                            {
                                "id": 1012,
                                "label": "菜单查询"
                            },
                            {
                                "id": 1013,
                                "label": "菜单新增"
                            },
                            {
                                "id": 1014,
                                "label": "菜单修改"
                            },
                            {
                                "id": 1015,
                                "label": "菜单删除"
                            }
                        ]
                    },
                    {
                        "id": 103,
                        "label": "部门管理",
                        "children": [
                            {
                                "id": 1016,
                                "label": "部门查询"
                            },
                            {
                                "id": 1017,
                                "label": "部门新增"
                            },
                            {
                                "id": 1018,
                                "label": "部门修改"
                            },
                            {
                                "id": 1019,
                                "label": "部门删除"
                            }
                        ]
                    },
                    {
                        "id": 104,
                        "label": "岗位管理",
                        "children": [
                            {
                                "id": 1020,
                                "label": "岗位查询"
                            },
                            {
                                "id": 1021,
                                "label": "岗位新增"
                            },
                            {
                                "id": 1022,
                                "label": "岗位修改"
                            },
                            {
                                "id": 1023,
                                "label": "岗位删除"
                            },
                            {
                                "id": 1024,
                                "label": "岗位导出"
                            }
                        ]
                    },
                    {
                        "id": 105,
                        "label": "字典管理",
                        "children": [
                            {
                                "id": 1025,
                                "label": "字典查询"
                            },
                            {
                                "id": 1026,
                                "label": "字典新增"
                            },
                            {
                                "id": 1027,
                                "label": "字典修改"
                            },
                            {
                                "id": 1028,
                                "label": "字典删除"
                            },
                            {
                                "id": 1029,
                                "label": "字典导出"
                            }
                        ]
                    },
                    {
                        "id": 106,
                        "label": "参数设置",
                        "children": [
                            {
                                "id": 1030,
                                "label": "参数查询"
                            },
                            {
                                "id": 1031,
                                "label": "参数新增"
                            },
                            {
                                "id": 1032,
                                "label": "参数修改"
                            },
                            {
                                "id": 1033,
                                "label": "参数删除"
                            },
                            {
                                "id": 1034,
                                "label": "参数导出"
                            }
                        ]
                    },
                    {
                        "id": 107,
                        "label": "通知公告",
                        "children": [
                            {
                                "id": 1035,
                                "label": "公告查询"
                            },
                            {
                                "id": 1036,
                                "label": "公告新增"
                            },
                            {
                                "id": 1037,
                                "label": "公告修改"
                            },
                            {
                                "id": 1038,
                                "label": "公告删除"
                            }
                        ]
                    },
                    {
                        "id": 108,
                        "label": "日志管理",
                        "children": [
                            {
                                "id": 500,
                                "label": "操作日志",
                                "children": [
                                    {
                                        "id": 1039,
                                        "label": "操作查询"
                                    },
                                    {
                                        "id": 1040,
                                        "label": "操作删除"
                                    },
                                    {
                                        "id": 1041,
                                        "label": "日志导出"
                                    }
                                ]
                            },
                            {
                                "id": 501,
                                "label": "登录日志",
                                "children": [
                                    {
                                        "id": 1042,
                                        "label": "登录查询"
                                    },
                                    {
                                        "id": 1043,
                                        "label": "登录删除"
                                    },
                                    {
                                        "id": 1044,
                                        "label": "日志导出"
                                    },
                                    {
                                        "id": 1045,
                                        "label": "账户解锁"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "id": 2,
                "label": "系统监控",
                "children": [
                    {
                        "id": 109,
                        "label": "在线用户",
                        "children": [
                            {
                                "id": 1046,
                                "label": "在线查询"
                            },
                            {
                                "id": 1047,
                                "label": "批量强退"
                            },
                            {
                                "id": 1048,
                                "label": "单条强退"
                            }
                        ]
                    },
                    {
                        "id": 110,
                        "label": "定时任务",
                        "children": [
                            {
                                "id": 1049,
                                "label": "任务查询"
                            },
                            {
                                "id": 1050,
                                "label": "任务新增"
                            },
                            {
                                "id": 1051,
                                "label": "任务修改"
                            },
                            {
                                "id": 1052,
                                "label": "任务删除"
                            },
                            {
                                "id": 1053,
                                "label": "状态修改"
                            },
                            {
                                "id": 1054,
                                "label": "任务导出"
                            }
                        ]
                    },
                    {
                        "id": 111,
                        "label": "数据监控"
                    },
                    {
                        "id": 112,
                        "label": "服务监控"
                    },
                    {
                        "id": 113,
                        "label": "缓存监控"
                    },
                    {
                        "id": 114,
                        "label": "缓存列表"
                    }
                ]
            },
            {
                "id": 3,
                "label": "系统工具",
                "children": [
                    {
                        "id": 115,
                        "label": "表单构建"
                    },
                    {
                        "id": 116,
                        "label": "代码生成",
                        "children": [
                            {
                                "id": 1055,
                                "label": "生成查询"
                            },
                            {
                                "id": 1056,
                                "label": "生成修改"
                            },
                            {
                                "id": 1057,
                                "label": "生成删除"
                            },
                            {
                                "id": 1058,
                                "label": "导入代码"
                            },
                            {
                                "id": 1059,
                                "label": "预览代码"
                            },
                            {
                                "id": 1060,
                                "label": "生成代码"
                            }
                        ]
                    },
                    {
                        "id": 117,
                        "label": "系统接口"
                    }
                ]
            },
            {
                "id": 4,
                "label": "若依官网"
            }
        ],
        "checkedKeys": [
            4,
            111,
            112,
            113,
            114,
            115,
            117,
            1000,
            1001,
            1002,
            1003,
            1004,
            1005,
            1006,
            1007,
            1008,
            1009,
            1010,
            1011,
            1012,
            1013,
            1014,
            1015,
            1016,
            1017,
            1018,
            1019,
            1020,
            1021,
            1022,
            1023,
            1024,
            1025,
            1026,
            1027,
            1028,
            1029,
            1030,
            1031,
            1032,
            1033,
            1034,
            1035,
            1036,
            1037,
            1038,
            1046,
            1047,
            1048,
            1049,
            1050,
            1051,
            1052,
            1053,
            1054,
            1055,
            1056,
            1057,
            1058,
            1059,
            1060,
            1039,
            1040,
            1041,
            1042,
            1043,
            1044,
            1045
        ]
    }
    res.send(toJson(body))
})
router.get('/system/menu/treeselect', (req, res) => {
    const body = {
        "msg": "操作成功",
        "code": 200,
        "data": [
            {
                "id": 1,
                "label": "系统管理",
                "children": [
                    {
                        "id": 100,
                        "label": "用户管理",
                        "children": [
                            {
                                "id": 1000,
                                "label": "用户查询"
                            },
                            {
                                "id": 1001,
                                "label": "用户新增"
                            },
                            {
                                "id": 1002,
                                "label": "用户修改"
                            },
                            {
                                "id": 1003,
                                "label": "用户删除"
                            },
                            {
                                "id": 1004,
                                "label": "用户导出"
                            },
                            {
                                "id": 1005,
                                "label": "用户导入"
                            },
                            {
                                "id": 1006,
                                "label": "重置密码"
                            }
                        ]
                    },
                    {
                        "id": 101,
                        "label": "角色管理",
                        "children": [
                            {
                                "id": 1007,
                                "label": "角色查询"
                            },
                            {
                                "id": 1008,
                                "label": "角色新增"
                            },
                            {
                                "id": 1009,
                                "label": "角色修改"
                            },
                            {
                                "id": 1010,
                                "label": "角色删除"
                            },
                            {
                                "id": 1011,
                                "label": "角色导出"
                            }
                        ]
                    },
                    {
                        "id": 102,
                        "label": "菜单管理",
                        "children": [
                            {
                                "id": 1012,
                                "label": "菜单查询"
                            },
                            {
                                "id": 1013,
                                "label": "菜单新增"
                            },
                            {
                                "id": 1014,
                                "label": "菜单修改"
                            },
                            {
                                "id": 1015,
                                "label": "菜单删除"
                            }
                        ]
                    },
                    {
                        "id": 103,
                        "label": "部门管理",
                        "children": [
                            {
                                "id": 1016,
                                "label": "部门查询"
                            },
                            {
                                "id": 1017,
                                "label": "部门新增"
                            },
                            {
                                "id": 1018,
                                "label": "部门修改"
                            },
                            {
                                "id": 1019,
                                "label": "部门删除"
                            }
                        ]
                    },
                    {
                        "id": 104,
                        "label": "岗位管理",
                        "children": [
                            {
                                "id": 1020,
                                "label": "岗位查询"
                            },
                            {
                                "id": 1021,
                                "label": "岗位新增"
                            },
                            {
                                "id": 1022,
                                "label": "岗位修改"
                            },
                            {
                                "id": 1023,
                                "label": "岗位删除"
                            },
                            {
                                "id": 1024,
                                "label": "岗位导出"
                            }
                        ]
                    },
                    {
                        "id": 105,
                        "label": "字典管理",
                        "children": [
                            {
                                "id": 1025,
                                "label": "字典查询"
                            },
                            {
                                "id": 1026,
                                "label": "字典新增"
                            },
                            {
                                "id": 1027,
                                "label": "字典修改"
                            },
                            {
                                "id": 1028,
                                "label": "字典删除"
                            },
                            {
                                "id": 1029,
                                "label": "字典导出"
                            }
                        ]
                    },
                    {
                        "id": 106,
                        "label": "参数设置",
                        "children": [
                            {
                                "id": 1030,
                                "label": "参数查询"
                            },
                            {
                                "id": 1031,
                                "label": "参数新增"
                            },
                            {
                                "id": 1032,
                                "label": "参数修改"
                            },
                            {
                                "id": 1033,
                                "label": "参数删除"
                            },
                            {
                                "id": 1034,
                                "label": "参数导出"
                            }
                        ]
                    },
                    {
                        "id": 107,
                        "label": "通知公告",
                        "children": [
                            {
                                "id": 1035,
                                "label": "公告查询"
                            },
                            {
                                "id": 1036,
                                "label": "公告新增"
                            },
                            {
                                "id": 1037,
                                "label": "公告修改"
                            },
                            {
                                "id": 1038,
                                "label": "公告删除"
                            }
                        ]
                    },
                    {
                        "id": 108,
                        "label": "日志管理",
                        "children": [
                            {
                                "id": 500,
                                "label": "操作日志",
                                "children": [
                                    {
                                        "id": 1039,
                                        "label": "操作查询"
                                    },
                                    {
                                        "id": 1040,
                                        "label": "操作删除"
                                    },
                                    {
                                        "id": 1041,
                                        "label": "日志导出"
                                    }
                                ]
                            },
                            {
                                "id": 501,
                                "label": "登录日志",
                                "children": [
                                    {
                                        "id": 1042,
                                        "label": "登录查询"
                                    },
                                    {
                                        "id": 1043,
                                        "label": "登录删除"
                                    },
                                    {
                                        "id": 1044,
                                        "label": "日志导出"
                                    },
                                    {
                                        "id": 1045,
                                        "label": "账户解锁"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "id": 2,
                "label": "系统监控",
                "children": [
                    {
                        "id": 109,
                        "label": "在线用户",
                        "children": [
                            {
                                "id": 1046,
                                "label": "在线查询"
                            },
                            {
                                "id": 1047,
                                "label": "批量强退"
                            },
                            {
                                "id": 1048,
                                "label": "单条强退"
                            }
                        ]
                    },
                    {
                        "id": 110,
                        "label": "定时任务",
                        "children": [
                            {
                                "id": 1049,
                                "label": "任务查询"
                            },
                            {
                                "id": 1050,
                                "label": "任务新增"
                            },
                            {
                                "id": 1051,
                                "label": "任务修改"
                            },
                            {
                                "id": 1052,
                                "label": "任务删除"
                            },
                            {
                                "id": 1053,
                                "label": "状态修改"
                            },
                            {
                                "id": 1054,
                                "label": "任务导出"
                            }
                        ]
                    },
                    {
                        "id": 111,
                        "label": "数据监控"
                    },
                    {
                        "id": 112,
                        "label": "服务监控"
                    },
                    {
                        "id": 113,
                        "label": "缓存监控"
                    },
                    {
                        "id": 114,
                        "label": "缓存列表"
                    }
                ]
            },
            {
                "id": 3,
                "label": "系统工具",
                "children": [
                    {
                        "id": 115,
                        "label": "表单构建"
                    },
                    {
                        "id": 116,
                        "label": "代码生成",
                        "children": [
                            {
                                "id": 1055,
                                "label": "生成查询"
                            },
                            {
                                "id": 1056,
                                "label": "生成修改"
                            },
                            {
                                "id": 1057,
                                "label": "生成删除"
                            },
                            {
                                "id": 1058,
                                "label": "导入代码"
                            },
                            {
                                "id": 1059,
                                "label": "预览代码"
                            },
                            {
                                "id": 1060,
                                "label": "生成代码"
                            }
                        ]
                    },
                    {
                        "id": 117,
                        "label": "系统接口"
                    }
                ]
            },
            {
                "id": 4,
                "label": "若依官网"
            }
        ]
    }
    res.send(toJson(body))
})
router.get('/system/role/list', (req, res) => {
    const body = {
        "total": 2,
        "rows": [
            {
                "createBy": null,
                "createTime": "2024-06-30 11:27:15",
                "updateBy": null,
                "updateTime": null,
                "remark": "超级管理员",
                "roleId": 1,
                "roleName": "超级管理员",
                "roleKey": "admin",
                "roleSort": 1,
                "dataScope": "1",
                "menuCheckStrictly": true,
                "deptCheckStrictly": true,
                "status": "0",
                "delFlag": "0",
                "flag": false,
                "menuIds": null,
                "deptIds": null,
                "permissions": null,
                "admin": true
            },
            {
                "createBy": null,
                "createTime": "2024-06-30 11:27:15",
                "updateBy": null,
                "updateTime": null,
                "remark": "普通角色",
                "roleId": 2,
                "roleName": "普通角色",
                "roleKey": "common",
                "roleSort": 2,
                "dataScope": "2",
                "menuCheckStrictly": true,
                "deptCheckStrictly": true,
                "status": "0",
                "delFlag": "0",
                "flag": false,
                "menuIds": null,
                "deptIds": null,
                "permissions": null,
                "admin": false
            }
        ],
        "code": 200,
        "msg": "查询成功"
    }
    res.send(toJson(body))
})


module.exports = router